/*
 * Toedo
 * Copyright (C) 2009-2010 J. Devauchelle and contributors.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 3 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

package org.toedo.preferences.pages;

import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.FileFieldEditor;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.toedo.gui.translations.Messages;
import org.toedo.preferences.PreferenceConstants;
import org.toedo.Activator;

public class DisplayPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

	public DisplayPage() {
		super(GRID);
		setPreferenceStore(Activator.getDefault().getPreferenceStore());
		setDescription(Messages.DisplayPage_Title);
	}
	
	@Override
	protected void createFieldEditors() {
		Label sectionLabel;		
		sectionLabel = new Label(getFieldEditorParent(), SWT.NONE);
		sectionLabel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
		
		addField(new FileFieldEditor(PreferenceConstants.DISPLAY_CUSTOM_CSS,
				Messages.DisplayPage_DisplayCss,
				getFieldEditorParent()));
		
		sectionLabel = new Label(getFieldEditorParent(), SWT.NONE);
		sectionLabel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
		
		addField(new StringFieldEditor(PreferenceConstants.DISPLAY_DATE_FORMAT,
				Messages.GeneralPage_DateFormat,
				getFieldEditorParent()));
		
		addField(new StringFieldEditor(PreferenceConstants.DISPLAY_TIME_FORMAT,
				Messages.DisplayPage_TimeFormat,
				getFieldEditorParent()));
	}

	@Override
	public void init(IWorkbench workbench) {
		// TODO Auto-generated method stub
		
	}



}
